import {createRouter, createWebHistory} from 'vue-router'

// 导入三个页面组件
import Knowledge from '../views/Knowledge.vue'
import Pictures from '../views/Pictures.vue'
import News from '../views/News.vue'

const routes = [
    {
        path: '/',
        redirect: '/knowledge' // 默认重定向到知识页
    },
    {
        path: '/knowledge',
        name: 'Knowledge',
        component: Knowledge
    },
    {
        path: '/pictures',
        name: 'Pictures',
        component: Pictures
    },
    {
        path: '/news',
        name: 'News',
        component: News
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router
